Component({
  data: {
    labelSelectId: 1, // 菜单选项被选中ID
    scrollViewHeight: 0, // 滚动视图高度
    optionList: [
      { id: 1, name: '选项一' },
      { id: 2, name: '选项二' },
      { id: 3, name: '选项三' },
      { id: 4, name: '选项四' },
    ]
  },
  methods: {
    sidebarLabelHandle(e) {
      let selectId = e.currentTarget.dataset.labelid; // 获取选中菜单ID
      let scrollHeight = (selectId - 1) * 100; // 选择左侧菜单选项，右侧跟随滚动视图高度
      this.setData({
        labelSelectId: selectId,
        scrollViewHeight: scrollHeight
      });
    }
  }
});